import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    // name: 'home',    没用的东西
    component: HomeView,
    redirect: '/sys-admin/admin',
    children: [
      {
        path: '/sys-admin/admin',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/Admin')
      },
      {
        path: '/sys-admin/temp/admin/add-new',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AdminAddNew.vue')
      },
      {
        path: '/sys-admin/temp/admin/list-admin',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AdminList.vue')
      },
      {
        path: '/sys-admin/temp/album/add-new',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AlbumAddNew.vue')
      },
      {
        path: '/sys-admin/temp/album/list-album',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AlbumList.vue')
      },
      {
        path: '/sys-admin/temp/category/add-new',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/CategoryAddNew.vue')
      },
      {
        path: '/sys-admin/temp/category/list-category',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/CategoryList')
      },
      {
        path: '/sys-admin/temp/brand/add-new',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/BrandAddNew')
      },
      {
        path: '/sys-admin/temp/brand/list-brand',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/BrandList')
      },
      {
        path: '/sys-admin/temp/attributeTemplate/add-new',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AttributeTemplateAddNew')
      },
      {
        path: '/sys-admin/temp/attributeTemplate/list-attributeTemplate',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AttributeTemplateList')
      },
      {
        path: '/sys-admin/temp/attribute/add-new',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AttributeAddNew')
      },
      {
        path: '/sys-admin/temp/attributeTemplate/list-attribute',
        // name: 'about',   没用的东西
        component: () => import( '../views/sys-admin/temp/AttributeList')
      },
      //==============================================
      {
        path: '/sys-admin/product/spu-add-new',
        component: () => import('../views/sys-admin/product/SpuAddNewStep1View.vue')
      },
      {
        path: '/sys-admin/product/spu-add-new2',
        component: () => import('../views/sys-admin/product/SpuAddNewStep2View.vue')
      },
      {
        path: '/sys-admin/product/spu-add-new3',
        component: () => import('../views/sys-admin/product/SpuAddNewStep3View.vue')
      },
      {
        path: '/sys-admin/product/spu-add-new4',
        component: () => import('../views/sys-admin/product/SpuAddNewStep4View.vue')
      }
    ]
  },
  {
    path: '/login',
    component: () =>import('../views/LoginView')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
